package com.kaibai.dao;

import com.kaibai.pojo.Good;

import java.sql.Connection;
import java.util.List;

public interface GoodDao {
    int insert(Connection conn, Good good);

    int deleteById(Connection conn,int id);

    int update(Connection conn,Good good);

    Good getGoodById(Connection conn, int id);

    List<Good> getAll(Connection conn);


    Integer getForPageTotalCount(Connection conn);

    List<Good> getForPageItems(Connection conn, int begin, int pageSize);

    Integer getForPageTotalCountByPrice(Connection conn, int min, int max);

    List<Good> getForPageItemsByPirce(Connection conn, int begin, int pageSize, int min, int max);

    Integer getForPageTotalCountByName(Connection conn, String name);

    List<Good> getForPageItemsByName(Connection conn, int begin, int pageSize, String name);

    Integer getForPageTotalCountBySearch(Connection conn, String name, int min, int max);

    List<Good> getForPageItemsBySearch(Connection conn, int begin, int pageSize, String name, int min, int max);
}
